package com.fgxia.admin.controller.web;


import cn.dev33.satoken.annotation.SaCheckPermission;
import com.fgxia.admin.service.IAdminSettleAccountsService;
import com.ruoyi.business.domain.bo.admin.AdminCompanySettleAccountsQueryBo;
import com.ruoyi.business.domain.bo.admin.AdminDriverSettleAccountsQueryBo;
import com.ruoyi.business.domain.vo.admin.AdminCompanySettleAccountsVo;
import com.ruoyi.business.domain.vo.admin.AdminDriverSettleAccountsVo;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * web端结算管理
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/web/settle-accounts")
public class WebSettleAccountsController extends BaseController {
    private final IAdminSettleAccountsService settleAccountsService;


    /**
     * 获取客户结算列表
     */
    @SaCheckPermission("settle-accounts:company:list")
    @GetMapping("/company/list")
    public TableDataInfo<AdminCompanySettleAccountsVo> listCompanySettleAccounts(AdminCompanySettleAccountsQueryBo queryBo, PageQuery pageQuery) {
        return settleAccountsService.listCompanySettleAccounts(queryBo, pageQuery);
    }

    /**
     * 获取司机结算列表
     */
    @SaCheckPermission("settle-accounts:driver:list")
    @GetMapping("/driver/list")
    public TableDataInfo<AdminDriverSettleAccountsVo> listDriverSettleAccounts(AdminDriverSettleAccountsQueryBo queryBo, PageQuery pageQuery) {
        return settleAccountsService.listDriverSettleAccounts(queryBo, pageQuery);
    }
}
